//
//  SAHelpFeedbackViewController.m
//  SunOn
//
//  Created by RazeenCheng on 2017/5/3.
//  Copyright © 2017年 NeoZhang. All rights reserved.
//

#import "SAHelpFeedbackViewController.h"
#import "SACompanyProfileListTableViewCell.h"

#import "SAOpinionFeedbackViewController.h" // 意见反馈

@interface SAHelpFeedbackViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation SAHelpFeedbackViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.tableView.dataSource = self;
    self.tableView.delegate = self;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    self.navigationController.navigationBarHidden = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 4;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    SACompanyProfileListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SACompanyProfileListTableViewCell" forIndexPath:indexPath];
    [cell configCellWithRow:indexPath.row withType:@"HelpFeedback"];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 54;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSInteger row = indexPath.row;
    
    if (row == 0) {
        // 在线客户
    } else if (row == 1) {
        // 常见问题
    } else if (row == 2) {
        // 意见反馈
        SAOpinionFeedbackViewController *opinionFeedbackVC = [self.storyboard instantiateViewControllerWithIdentifier:@"SAOpinionFeedbackViewController"];
        [self.navigationController pushViewController:opinionFeedbackVC animated:YES];
    } else if (row == 3) {
        // 关于我们
    }
}

@end
